package com.jh.user.service.freeQuick;

import cn.jh.common.exception.ServiceException;
import cn.jh.common.pay.jdpush.PayBarException;
import com.jh.user.pojo.UserAccount;
import com.jh.user.pojo.UserBankInfo;
import com.jh.user.pojo.freeQuick.BindCardNotify;
import com.jh.user.pojo.freeQuick.PassageWayRegister;
import com.jh.user.pojo.freeQuick.PassagewayBankInfo;
import com.jh.user.pojo.freeQuick.PayBarRequestOrder;
import net.sf.json.JSONArray;
import org.springframework.data.domain.Pageable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author Yichuan
 * @version 1.0
 */
public interface FreeQuickService {

    /**
     * 查询通道商户是否注册
     * @param entity
     * @return
     */
    PassageWayRegister queryRegisterMerchant(PassageWayRegister entity);


    Map bindCard(UserBankInfo card, String merchantNo,int channelId,int id) throws PayBarException;

    PassagewayBankInfo queryBankInfoAndChannelProductCode(String bankCardNo,String channelProductCode);

    /**
     * 开通通道
     * @param entity
     * @return
     */
    Map registerProduct(PassageWayRegister entity, long userId) throws ServiceException;

    /**
     * 注册商户
     * @return 返回注册结果信息
     */
    Map registerMerchant(PassageWayRegister entity, String userId) throws PayBarException;


    /**
     * 处理绑卡异步回调业务
     *
     * @param notify 绑卡异步回调信息
     * @return 返回绑卡订单信息
     */
    PayBarRequestOrder processBindCardNotify(BindCardNotify notify) throws PayBarException;

    void saveUserAccount(UserAccount account);

    Map bindCardConfirm(String smsCode,long userId,String bankCode) throws ServiceException;

    PassageWayRegister processPayNotify(BindCardNotify notify) throws PayBarException;

    Map modifyMerchantFeeInfo(String requestNo,String merchantNo,String channelProductCode,String cardType,String bizType,String feeValue) throws ServiceException;

    Map<String, String> queryMerchantFeeInfo(String merchantNo) throws ServiceException;

    Map<String, Object> queryMerchantFeeInfoList(String merchantNo, String merchantName, String pwrStatus, String bindMobile, Pageable pageable);

//    Map<String, String> modifyMerchantSettlementInfo(String mobilePhone, String bindMobile, String settleBankAccountNo, String topName,
//                                                     String bankSubName, String bankNo) throws ServiceException;

    Map<String, String> modifyMerchantSettlementInfo(String lineNo, String province, String city, String phone, String bankBranchName, String cardType,
                                                     String bankName, String userName, String abbreviation, long userId, String beforeCardNo, String cardNo,
                                                     String securityCode, String expiredTime) throws ServiceException;

    JSONArray queryBankCardList(String merchantNo, String channelProductCode) throws ServiceException;

    Map<String, String> queryMerchantWallet(String merchantNo) throws ServiceException;

    Map<String, String> modifyMerchantFeeInfoo(String merchantNo, String channelProductCode, String cardType, String bizType, BigDecimal feeValue, BigDecimal capAmount) throws ServiceException;

    Map<String, Object> getMerchantInfo(String merchantNo, String channelProductCode) throws ServiceException;

    Map<String, String> queryMerchantInfo(String idCard, String channelProductCode) throws ServiceException;

    Map<String, String> queryMerchantNo(String merchantNo) throws ServiceException;
}
